import navBottom from '../common/nav-bottom.vue'
import './index.scss';
import XHeader from 'vux/src/components/x-header/index.vue'
import CONSTANT from '@/common/constants.js';
import http from '@/common/http.js';

export default {
  name: 'articleDetails',
  components: {navBottom, XHeader},
  data () {
    return {
      newsView: '',
      header:'公益天地',
      showHeader:true,
    }
  },
  mounted () {
    if (this.$emit('ifOpenid')) {
      this.$emit('ifOpenid', this.$route.path)
    }
    let showHeader = this.$route.query.showHeader;
    let header = this.$route.query.header;
    if (showHeader != null && showHeader != '' && showHeader == -1) {
      this.showHeader = false
    }
    if (header != null && header != '') {
      this.header = header
    }
    console.log(this.$route.query.id)
    http.post(CONSTANT.NEWS_VIEW, {id: this.$route.query.id}, (res) => {
      console.log(res)
      if (res.code == 200) {
        this.newsView = res.obj
      }
    })
  }
}
